#pragma once
#include "xKernel/IxPaintSchedule.h"

[
    default(IxPaintSchedule),
    threading(free),
    uuid("6A71ED97-37C4-4436-915B-FF55189F60C0"),
    coclass
]
class ATL_NO_VTABLE CxPaintSchedule : public IxPaintSchedule
{
    typedef std::pair<INT, INT>                         INTPAIR;
    typedef std::multimap<INTPAIR, CComPtr<IxView> >    VIEWMAP;
    typedef std::set<ULONGLONG>                         ULLSET;

public:
    CxPaintSchedule();
    virtual ~CxPaintSchedule();

public:
    // interface of IxLayoutSchedule
    HRESULT AddView(IxView* pView);
    HRESULT Paint(IxCanvas* pCanvas);

protected:
    void    _add_ancestor_view_recursive(IxNode* pNode);
    void    _add_child_view_recursive(IxNode* pNode);

protected:
    VIEWMAP     m_mapViews;
    ULLSET      m_setViews;
};